package com.bolt.support.spring.jpa.entity;

import com.bolt.convention.validation.groups.Update;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * 框架提供一个基础的Native方式的实体对象定义参考
 * 具体可根据项目考虑选用其他主键如自增、序列等方式，只需修改相关泛型参数类型和主键定义注解即可
 */
@Getter
@Setter
@Access(AccessType.FIELD)
@MappedSuperclass
public class BaseNativeEntity extends BaseEntity<Long> {

    @Id
    @NotNull(groups = Update.class)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

}
